package com.luoyuanxiangvip.admin.controller;


import com.luoyuanxiangvip.admin.controller.support.BaseController;
import com.luoyuanxiangvip.core.entity.BizCategory;
import com.luoyuanxiangvip.core.service.IBizCategoryService;
import com.luoyuanxiangvip.common.utils.AjaxResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.shiro.authz.annotation.RequiresAuthentication;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author luoyuanxiang <p>luoyuanxiangvip.com</p>
 * @since 2019-05-26
 */
@RestController
@RequestMapping("/admin/category")
@RequiresAuthentication
@Api(description = "类别管理")
public class BizCategoryController extends BaseController<IBizCategoryService, BizCategory, Long> {

    @ApiOperation(value = "分类条数查询")
    @GetMapping("/categoryCount")
    public AjaxResult categoryCount() {
        int count = getiService().count();
        return AjaxResult.success("分类条数查询成功", count);
    }
}
